<template>
  <a-descriptions title="量表评估" bordered :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
    <a-descriptions-item label="疾病评估" :span="2" bordered v-if="hasDisease">
      <div v-if="report.angiocardiopathyReport">
        <p>量表名称：心血管10年风险评估</p>
        <p>评估时间：{{ report.angiocardiopathyReport.evaluationTime }}</p>
        <p>评估结果：{{ report.angiocardiopathyReport.result }}</p>
      </div>
      <div v-if="report.diabetesReport">
        <a-divider />
        <p>量表名称：糖尿病风险评估</p>
        <p>评估时间：{{ report.diabetesReport.evaluationTime }}</p>
        <p v-html="`评估结果：${report.diabetesReport.result}`"></p>
      </div>
    </a-descriptions-item>
    <a-descriptions-item label="行为评估" :span="2" bordered v-if="hasBeha">
      <div v-if="report.sdscaReport">
        <p>量表名称：自我管理行为(SDSCA)评估</p>
        <p>评估时间：{{ report.sdscaReport.evaluationTime }}</p>
        <p>评估结果：{{ report.sdscaReport.result }}</p>
      </div>
      <div v-if="report.bmqReport">
        <a-divider />
        <p>量表名称：服药信念量表（BMQ）评估</p>
        <p>评估时间：{{ report.bmqReport.evaluationTime }}</p>
        <p>评估结果：{{ report.bmqReport.result }}</p>
      </div>
      <div v-if="report.mmas8Report">
        <a-divider />
        <p>量表名称：Morisky用药依从性问卷（MMAS-8）评估</p>
        <p>评估时间：{{ report.mmas8Report.evaluationTime }}</p>
        <p>评估结果：{{ report.mmas8Report.result }}</p>
      </div>
    </a-descriptions-item>
    <a-descriptions-item label="心理评估" :span="2" bordered v-if="hasMind">
      <div v-if="report.sasReport">
        <p>量表名称：焦虑自评（SAS）</p>
        <p>评估时间：{{ report.sasReport.evaluationTime }}</p>
        <p>评估结果：{{ report.sasReport.result }}</p>
      </div>
      <div v-if="report.sdsReport">
        <a-divider />
        <p>量表名称：抑郁自评（SDS）</p>
        <p>评估时间：{{ report.sdsReport.evaluationTime }}</p>
        <p>评估结果：{{ report.sdsReport.result }}</p>
      </div>
      <div v-if="report.jobReport">
        <a-divider />
        <p>量表名称：马氏工作倦怠通用量表</p>
        <p>评估时间：{{ report.jobReport.evaluationTime }}</p>
        <p>评估结果：{{ report.jobReport.result }}</p>
      </div>
      <div v-if="report.sleepReport">
        <a-divider />
        <p>量表名称：匹兹堡睡眠评估</p>
        <p>评估时间：{{ report.sleepReport.evaluationTime }}</p>
        <p>评估结果：{{ report.sleepReport.result }}</p>
      </div>
      <div v-if="report.happyReport">
        <a-divider />
        <p>量表名称：总体幸福感测试</p>
        <p>评估时间：{{ report.happyReport.evaluationTime }}</p>
        <p>评估结果：{{ report.happyReport.result }}</p>
      </div>
    </a-descriptions-item>
  </a-descriptions>
</template>

<script>
export default {
  name: 'Evaluation',
  props: ['report'],
  data() {
    return {}
  },
  computed: {
    hasDisease() {
      return this.report.angiocardiopathyReport || this.report.diabetesReport
    },
    hasBeha() {
      return this.report.sdscaReport || this.report.bmqReport || this.report.mmas8Report
    },
    hasMind() {
      return (
        this.report.sasReport ||
        this.report.sdsReport ||
        this.report.jobReport ||
        this.report.sleepReport ||
        this.report.happyReport
      )
    }
  },
  methods: {}
}
</script>

<style lang="less" scoped>
/deep/ .ant-descriptions-item-label {
  width: 25% !important;
}
/deep/ .ant-descriptions-item-content {
  width: 75% !important;
}
</style>

